package net.esj.basic.service;

import java.util.List;

import net.esj.basic.dao.querybuilder.QueryBuilder;
import net.esj.basic.utils.Pagination;

public interface QueryBuilderService {


	
	<T> List<T> queryListByQueryBuilder(QueryBuilder qb,Class<T> clazz);
	
	<T> List<T> queryTopByQueryBuilder(QueryBuilder qb, int count,Class<T> clazz);
	
	<T> Pagination queryPageByQueryBuilder(Pagination page,Class<T> clazz);
	
	/**
	 * 不带转换格式
	 * @param qb
	 * @return
	 */
	int queryCountByQueryBuilder(QueryBuilder qb);
	
	List queryListByQueryBuilder(QueryBuilder qb);
	
	List queryTopByQueryBuilder(QueryBuilder qb, int count);
	
	Pagination queryPageByQueryBuilder(Pagination page);
	
	Pagination queryPageByQueryBuilder(Pagination page,boolean resolveSearcher);
	
	Object queryFirst(QueryBuilder qb);
	
	<T> T queryFirst(QueryBuilder qb,Class<T> clazz);
	
	<T extends QueryBuilder >QueryBuilder createQueryBuilder(Class<T> qbClass,Class clazz);
	
	QueryBuilder createQueryBuilder(Class clazz);
	
	Object queryMaxByQueryBuilder(QueryBuilder qb,String key);
	
	Long querySumByQueryBuilder(QueryBuilder qb,String key);
}
